package com.atguigu.gmall.item.controller;

import com.atguigu.gmall.item.service.ItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Api("详情页数据汇总")
@RestController
@RequestMapping("/api/item")
public class ItemIndexController {

    @Autowired
    private ItemService itemService;

    @ApiOperation("数据汇总")
    @GetMapping("/{skuId}")
    public Map getItem(@PathVariable Long skuId){
        Map ItemMap = itemService.getItem(skuId);
        return ItemMap;
    }



}
